import Vue from "vue";
import Vuex from "vuex";
import { getLocalStorage, setLocalStorage, setJsonLocalStorage } from "@/assets/js/storage/storage.js";
import { route } from "@/assets/js/common/language/route.js";
Vue.use(Vuex);
const Switch_Lang = 'Switch_Lang';  // 切换中英文
const language = (getLocalStorage("languageSet")) || "zh";
export default new Vuex.Store({
  state: {
    language
  },
  mutations: {
    [Switch_Lang](state, language) {//language
      setLocalStorage("languageSet", language, 15552000); //缓存半年
      setLocalStorage("languageRoute", route, 15552000); //缓存半年
      state.language = language;
    },
  },
  getters: {
    getteruser: (state) => state.language,
  },
  actions: {
  },
  modules: {
  }
});
